@extends('plugin.hostserver.front.layout.base')
@section('content')
    <div id="pricingTable2" class="domains-page">
        <div class="container">
            <div class="section-title">
                <h2>注册域名</h2>
            </div>
            <form action="{{ plugin_route('hostserver.user.renewal.domain') }}" method="post">
                <input type="hidden" name="domain" value="{{ $show['name'] }}">
                <input type="hidden" name="id" value="{{ $show['id'] }}">
                @csrf
                <table>
                    <thead>
                    <tr>

                        <th>域名</th>
                        <th>年限</th>
                        <th>价格（元）</th>

                    </tr>
                    </thead>
                    <tbody>

                    <tr>

                        <td data-label="域名">{{ $show['name'] }}</td>

                        <td data-label="年限">
                            <select class="form-control" name="year" id="ytime">
                                <option value="1" data-money="{{ $price['price'] }}">1年</option>
                                <option value="2"  data-money="{{ $price['renewal_price'] }}">2年</option>
                                <option value="3"  data-money="{{ $price['renewal_price'] }}">3年</option>
                                <option value="4"  data-money="{{ $price['renewal_price'] }}">4年</option>
                                <option value="5"  data-money="{{ $price['renewal_price'] }}">5年</option>
                                <option value="6"  data-money="{{ $price['renewal_price'] }}">6年</option>
                                <option value="7"  data-money="{{ $price['renewal_price'] }}">7年</option>
                                <option value="8"  data-money="{{ $price['renewal_price'] }}">8年</option>
                                <option value="9"  data-money="{{ $price['renewal_price'] }}">9年</option>
                                <option value="10"  data-money="{{ $price['renewal_price'] }}">10年</option>
                            </select>
                        </td>

                        </td>

                        <td data-label="" class="wdngjh_money">{{ $price['price'] }}</td>


                    </tr>

                    </tbody>
                </table>
                <p class="pull-right" style="width: 100%;text-align: right;margin-top: 20px;font-size: 16px">订单金额： <span
                            class="color_ff6900 ">￥<span class="wdngjh_money text-danger"
                                                         style="font-size: 18px">{{ $price['price'] }}</span></span></p>

                <p class="pull-right" style="width: 100%;margin-top: 10px;">

                    <input type="password" name="buy_password" class="form-control" id="pay_pass" rq="1"
                           placeholder="支付密码"
                           style="float: right; width: 150px" autocomplete="off">
                </p>

                <p class="pull-right" style="width: 100%;">
                    <button class="btn btn-custom-reverse pull-right ajax-submit  btn-custom-reverse"
                            style="color:#fff;margin-top: 40px;">续费
                    </button>
                </p>
            </form>
        </div>
    </div>
@endsection
@section('foot_js')

    <script>
        var first_price="{{ $price['price'] }}";
        var money = "{{ $price['price'] }}"
        $("#ytime").change(function () {
            money=$(this).find('option:selected').data('money');
            var year=$(this).val();
            if(year>1)
            {
                money=parseInt(money)*(year-1)+parseInt(first_price);
            }
            $(".wdngjh_money").text(money);
        })
    </script>
@endsection